// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 新建用户, 初始密码为szCLOU@2024 POST /sys/user/add */
export async function sysUserControllerSave(
  body: API.SysUserForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/user/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量新建用户, 无法更新用户 POST /sys/user/batch */
export async function sysUserControllerSaveBatch(body: {}, options?: { [key: string]: any }) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/user/batch`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 DELETE /sys/user/del */
export async function sysUserControllerDelete(body: number[], options?: { [key: string]: any }) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/user/del`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改用户信息 PUT /sys/user/edit */
export async function sysUserControllerEdit(
  body: API.SysUserUpdateForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/user/edit`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据查询条件导出用户信息 GET /sys/user/export */
export async function sysUserControllerExport(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysUserControllerExportParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/sys/user/export`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 根据查询条件分页获取用户信息 GET /sys/user/list */
export async function sysUserControllerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysUserControllerListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationSysUserVO>(`${apiPrefix}/sys/user/list`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取用户真实手机号 GET /sys/user/phone */
export async function sysUserControllerGetUserRealPhone(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysUserControllerGetUserRealPhoneParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/user/phone`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 重置用户密码 PUT /sys/user/reset */
export async function sysUserControllerResetPassword(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysUserControllerResetPasswordParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/user/reset`, {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 禁用/启用用户 PUT /sys/user/setStatus */
export async function sysUserControllerSetStatus(
  body: API.SysUserSetStatusForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/user/setStatus`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 解冻用户 PUT /sys/user/thaw */
export async function sysUserControllerThaw(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysUserControllerThawParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/user/thaw`, {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
